package com.elawlink.es;

import lombok.Data;
import org.springframework.data.annotation.Id;
import org.springframework.data.elasticsearch.annotations.Document;
import org.springframework.data.elasticsearch.annotations.Field;
import org.springframework.data.elasticsearch.annotations.FieldType;

/**
 * @Author skh
 * @Date 2020/3/25 19:40
 * @Desc
 */
@Data
//指定索引名称和type名称
@Document(indexName = "index_blog", type = "article")
public class Article {

    @Id
    //定义字段类型,是否存储,是否分词
    @Field(type = FieldType.Long, store = true)
    private Long id;

    @Field(type = FieldType.Text, store = true, analyzer = "ik_smart")
    private String title;

    @Field(type = FieldType.Text, store = true, analyzer = "ik_smart")
    private String content;
}

